Ext.define('Admin.view.leavehistory.LeaveHistoryGrid', {
    extend: 'Ext.grid.Panel',
    id: 'leaveHistory-grid',
    xtype: 'leaveHistoryGrid-grid',
    title: '请假历史记录',
    iconCls: 'x-fa fa-arrow-circle-o-up',
    //cls: 'user-grid',


    bind: '{leaveHistoryGridStore}',       //viewModeld的store
    //sm:new Ext.grid.CheckboxSelectionModel(),
    columns: [
        { header: '工号', dataIndex: 'userId', width: 60, sortable: true }
        , { header: '申请时间', dataIndex: 'applyTime', width: 150, sortable: true, renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s') }
        , { header: '实际开始时间', dataIndex: 'realityStartTime', width: 150, sortable: true, renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s') }
        , { header: '实际结束时间', dataIndex: 'realityEndTime', width: 150, sortable: true, renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s') }
        , { header: '请假等级', dataIndex: 'leaveType', width: 80, sortable: true }
        , { header: '请假原因', dataIndex: 'reason', width: 180, sortable: true }
        , { header: '状态', dataIndex: 'state', width: 90, sortable: true }
    ],
    dockedItems: {
        xtype: 'toolbar',
        dock: 'top',

        items: [
            {
                xtype: 'textfield',
                fieldLabel: '申请人',
                name: 'name',
                reference: 'leaveGridSerchByUserId',
                listeners: {
                    change: {
                        fn: 'leaveHistoryGridPanelSearch'
                    }
                }
            }, {
                xtype: 'datefield',
                fieldLabel: '申请时间',
                name: 'applicationTime',
                format: 'Y-m-d',
                reference: 'leaveGridSerchByApplyTime',
                listeners: {
                    change: {
                        fn: 'leaveHistoryGridPanelSearch'
                    }
                }
            },
            {
                text: '清空',
                listeners: {
                    click: 'leaveHistoryGridPanelclear' //快捷查询按钮
                }
            }
        ]
    },
    bbar: Ext.create('Ext.PagingToolbar', {
        bind: '{leaveHistoryGridStore}',
        displayInfo: true,
        displayMsg: '显示第 {0} - {1} 条数据 总计 {2}',
        emptyMsg: "没有任何数据"
    })
});
